//
//  ImageAudioSequenceViewController.h
//  SadTrombone
//
//  Created by Demis Bellot on 19/04/2009.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>


typedef enum {
	SequenceBehaviourNormal			= 1,
	SequenceBehaviourReverseAtEnds	= 2
} SequenceBehaviour;

@interface ImageAudioSequenceViewController : UIViewController<AVAudioPlayerDelegate> {
	AVAudioPlayer* audioPlayer;
	NSTimer* sequenceTimer;
	NSMutableArray* images;
    UIImageView *imageView;
	NSString* audioFileName;
	UIButton* playButton;
	NSInteger sequenceNumber;
	float sequenceInterval;
	float lastSequenceInterval;
	BOOL autoPlay;
}

@property (nonatomic, retain) NSMutableArray *images;
@property (nonatomic, retain) UIImageView *imageView;
@property (nonatomic, retain) NSString* audioFileName;
@property (nonatomic, retain) UIButton* playButton;
@property (nonatomic, retain) NSTimer* sequenceTimer;
@property (readwrite) float sequenceInterval;
@property (readwrite) float lastSequenceInterval;
@property (readwrite) BOOL autoPlay;

- (void)setImageNames:(NSMutableArray*)imageNames 
	sequenceBehaviour:(SequenceBehaviour)imageSequenceBehaviour
		audioFileName:theAudioFileName
		   playButton:(UIButton*)aPlayButton;

- (void) play;
- (void) playAudio;
- (void) restart;
- (void) nextSequence;
- (UIImage*) currentImage;

@end

